<template>
    <div>
        <button>哈哈</button>
        <div class="box animate__animated animate__swing">

        </div>
        <!-- 轮播图 -->
        <div>
            <Banner2 />
        </div>
        <!-- 图表 -->
        <div>
            <div id="main" style="width: 600px;height:400px;"></div>
        </div>
    </div>
</template>

<script>
import 'animate.css';
import Banner2 from '../components/Banner2.vue';
// import * as echarts from 'echarts';
export default {
    components: {
        Banner2
    },
    mounted() {
        this.getEcharts()
    },
    methods: {
        getEcharts() {
            // 基于准备好的dom，初始化echarts实例
            var myChart = this.$echarts.init(document.getElementById('main'));
            // 绘制图表
            myChart.setOption({
                title: {
                    text: 'ECharts 入门示例'
                },
                tooltip: {},
                xAxis: {
                    data: ['衬衫', '羊毛衫', '雪纺衫', '裤子', '高跟鞋', '袜子']
                },
                yAxis: {},
                series: [
                    {
                        name: '销量',
                        type: 'bar',
                        data: [5, 20, 36, 10, 10, 20]
                    }
                ]
            });
        }
    }
}
</script>

<style scoped>
.box {
    width: 300px;
    height: 400px;
    background-color: rebeccapurple;
    margin: 50px auto;
}
</style>